<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: geo_zones.php 47 2013-09-21 11:56:37Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 47 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:56:37 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

require('includes/application_top.php');

switch ($_GET['saction']) {
	case 'insert_sub':
		$zID = $_GET['zID'];
		$zone_country_id = $_POST['zone_country_id'];
		$zone_id = $_POST['zone_id'];

		$db->db_query("INSERT INTO
							".TABLE_ZONES_TO_GEO_ZONES."
							(zone_country_id, zone_id, geo_zone_id, date_added)
						VALUES
							(".$db->db_prepare($zone_country_id).", ".$db->db_prepare($zone_id).", ".$db->db_prepare($zID).", NOW())");
		$new_subzone_id = $db->db_insert_id();

		redirect(href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$new_subzone_id));
	break;

	case 'save_sub':
		$sID = $_GET['sID'];
		$zID = $_GET['zID'];
		$zone_country_id = $_POST['zone_country_id'];
		$zone_id = $_POST['zone_id'];

		$db->db_query("UPDATE
							".TABLE_ZONES_TO_GEO_ZONES."
						SET
							geo_zone_id = ".$db->db_prepare($zID).",
							zone_country_id = ".$db->db_prepare($zone_country_id).",
							zone_id = ".(($db->db_prepare($zone_id)) ? $db->db_prepare($zone_id) : 'null').",
							last_modified = NOW()
						WHERE
							association_id = ".$db->db_prepare($sID));

		redirect(href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$_GET['sID']));
	break;

	case 'deleteconfirm_sub':
		$sID = $_GET['sID'];

		$db->db_query("DELETE FROM ".TABLE_ZONES_TO_GEO_ZONES." WHERE association_id = ".$db->db_prepare($sID));
		redirect(href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage']));
	break;
}

switch ($_GET['action']) {
	case 'insert_zone':
		$geo_zone_name = $_POST['geo_zone_name'];
		$geo_zone_description = $_POST['geo_zone_description'];

		$db->db_query("INSERT INTO
							".TABLE_GEO_ZONES."
							(geo_zone_name, geo_zone_description, date_added)
						VALUES
							(".$db->db_prepare($geo_zone_name).", ".$db->db_prepare($geo_zone_description).", NOW())");
		$new_zone_id = $db->db_insert_id();

		redirect(href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$new_zone_id));
	break;

	case 'save_zone':
		$zID = $_GET['zID'];
		$geo_zone_name = $_POST['geo_zone_name'];
		$geo_zone_description = $_POST['geo_zone_description'];

		$db->db_query("UPDATE
							".TABLE_GEO_ZONES."
						SET
							geo_zone_name = ".$db->db_prepare($geo_zone_name).",
							geo_zone_description = ".$db->db_prepare($geo_zone_description).",
							last_modified = NOW()
						WHERE
							geo_zone_id = ".$db->db_prepare($zID));

		redirect(href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID']));
	break;

	case 'deleteconfirm_zone':
		$zID = $_GET['zID'];

		$db->db_query("DELETE FROM ".TABLE_GEO_ZONES." WHERE geo_zone_id = ".$db->db_prepare($zID));
		$db->db_query("DELETE FROM ".TABLE_ZONES_TO_GEO_ZONES." WHERE geo_zone_id = ".$db->db_prepare($zID));

		redirect(href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage']));
	break;
}
require(DIR_WS_INCLUDES.'metatag.php');
if ($_GET['zID']  && (($_GET['saction'] == 'edit') || ($_GET['saction'] == 'new'))) { ?>
<script type="text/javascript">
	<!--
		function resetZoneSelected(theForm) {
			if (theForm.state.value != '') {
				theForm.zone_id.selectedIndex = '0';
				if (theForm.zone_id.options.length > 0) {
					theForm.state.value = '<?php echo JS_STATE_SELECT; ?>';
				}
			}
		}

		function update_zone(theForm) {
			var NumState = theForm.zone_id.options.length;
			var SelectedCountry = "";
			while(NumState > 0) {
				NumState--;
				theForm.zone_id.options[NumState] = null;
			}
			SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;
			<?php echo js_zone_list('SelectedCountry', 'theForm', 'zone_id'); ?>
		}
	//-->
</script>
<?php } ?>
</head>
<body>
<?php require(DIR_WS_INCLUDES.'header.php'); ?>
<div id="wrapper">
<table class="outerTable" cellspacing="0" cellpadding="0">
  <tr>
    <td class="columnLeft2" width="<?php echo BOX_WIDTH; ?>" valign="top">
		<?php require(DIR_WS_INCLUDES.'column_left.php'); ?>
	</td>
    <td class="boxCenter" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%">
			<table class="table_pageHeading" border="0" width="100%" cellspacing="0" cellpadding="0">
			  <tr>
			    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
			  </tr>
			</table>
		</td>
      </tr>
      <tr>
        <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top">
			<?php
			  if ($_GET['action'] == 'list') {
			?>
            <table width="100%" cellspacing="0" cellpadding="0" class="dataTable">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_ZONE; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
				<?php
				    $sql = "SELECT 
	    						a.association_id, 
	    						a.zone_country_id, 
	    						c.countries_name, 
	    						a.zone_id, 
	    						a.geo_zone_id, 
	    						a.last_modified, 
	    						a.date_added, 
	    						z.zone_name 
	    					FROM 
	    						".TABLE_ZONES_TO_GEO_ZONES." a 
	    						LEFT JOIN 
	    							".TABLE_COUNTRIES." c 
	    							ON a.zone_country_id = c.countries_id 
	    						LEFT JOIN 
	    							".TABLE_ZONES." z 
	    							ON a.zone_id = z.zone_id 
	    					WHERE 
	    						a.geo_zone_id = ".$_GET['zID']." 
	    					ORDER BY 
	    						association_id";
					    						
				    $query = page_break_create($_POST['per_site'], $_GET['page'], $sql, 'geo_zones.php');
			    
			    	$zones = $query['query'];
				    while(!$zones->EOF) {$rows++;
				      $rows++;
				      if (((!$_GET['sID']) || (@$_GET['sID'] == $zones->fields['association_id'])) && (!$sInfo) && (substr($_GET['saction'], 0, 3) != 'new')) {
				        $sInfo = new objectInfo($zones->fields);
				      }
				      if ( (is_object($sInfo)) && ($zones->fields['association_id'] == $sInfo->association_id) ) {
				        echo '<tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\''.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id.'&saction=edit').'\'">'."\n";
				      } else {
						if ($rows % 2 == 0)
				    		$f = 'dataTableRow';
				    	else
				    		$f = '';
				        echo '<tr class="'.$f.'" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\''.$f.'\'" onclick="document.location.href=\''.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$zones->fields['association_id']).'\'">'."\n";
				      }
				?>
                <td class="dataTableContent"><?php echo (($zones->fields['countries_name']) ? $zones->fields['countries_name'] : TEXT_ALL_COUNTRIES); ?></td>
                <td class="dataTableContent"><?php echo (($zones->fields['zone_id']) ? $zones->fields['zone_name'] : PLEASE_SELECT); ?></td>
                <td class="dataTableContent" align="right"><?php if ( (is_object($sInfo)) && ($zones->fields['association_id'] == $sInfo->association_id) ) { echo image(DIR_WS_IMAGES.'icon_arrow_right.gif', ''); } else { echo '<a href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$zones->fields['association_id']).'">'.image(DIR_WS_IMAGES.'icon_info.gif', IMAGE_ICON_INFO).'</a>'; } ?>&nbsp;</td>
				<?php
					echo '</tr>';
						$zones->MoveNext();
				    }
				?>
			</table>
			<table width="100%">
              <tr class="page_break">
					<td class="smallText" valign="top" width="33.3%"><?php echo 'Angezeigt werden '.$query['from'].' bis '.$query['to'].' (von insgesamt '.$query['total'].' Bundesländern)'; ?></td>
					<td class="smallText" align="center" width="33.3%"></td>
					<td class="smallText" align="right" width="33.3%">
						Bundesländer pro Seite: <?php echo $query['page_break']->perSiteDropdown($_GET['page']); ?>
					</td>
				</tr>
				<tr><td align="center" colspan="3"><?php echo '<br />'.$query['links']; ?></td></tr>
              <tr>
                <td align="right" colspan="3"><?php if (!$_GET['saction']) echo '<a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID']).'">'.BUTTON_BACK.'</a> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id.'&saction=new').'">'.BUTTON_INSERT.'</a>'; ?></td>
              </tr>
            </table>
			<?php
			  } else {
			?>
            <table width="100%" cellspacing="0" cellpadding="0" class="dataTable">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_ZONES; ?></td>
                <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
              </tr>
			<?php
			    $zones = $db->db_query("SELECT geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added FROM ".TABLE_GEO_ZONES." ORDER BY geo_zone_name");
			    
			    while(!$zones->EOF) {
					if (((!$_GET['zID']) || (@$_GET['zID'] == $zones->fields['geo_zone_id'])) && (!$zInfo) && (substr($_GET['action'], 0, 3) != 'new')) {
						$num_zones = $db->db_query("SELECT COUNT(*) AS num_zones FROM ".TABLE_ZONES_TO_GEO_ZONES." WHERE geo_zone_id = '".$zones->fields['geo_zone_id']."' group by geo_zone_id");
						if($num_zones->_numOfRows > 0)
							$zones->fields['num_zones'] = $num_zones->fields['num_zones'];
						else
							$zones->fields['num_zones'] = 0;

						$zInfo = new objectInfo($zones->fields);
					}
					if((is_object($zInfo)) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id))
						echo '<tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'pointer\'" onclick="document.location.href=\''.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=list').'\'">'."\n";
					else
						echo '<tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\''.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zones->fields['geo_zone_id']).'\'">'."\n";
			?>
			      <td class="dataTableContent"><?php echo '<a href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zones->fields['geo_zone_id'].'&action=list').'">'.image(DIR_WS_ICONS.'folder.gif', ICON_FOLDER).'</a>&nbsp;'.$zones->fields['geo_zone_name']; ?></td>
			      <td class="dataTableContent" align="right"><?php if ( (is_object($zInfo)) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id) ) { echo image(DIR_WS_IMAGES.'icon_arrow_right.gif'); } else { echo '<a href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zones->fields['geo_zone_id']).'">'.image(DIR_WS_IMAGES.'icon_info.gif', IMAGE_ICON_INFO).'</a>'; } ?>&nbsp;</td>
			<?php
				echo '</tr>';
					$zones->MoveNext();
			    }
			?>
            </table>
			<table border="0" width="100%" cellspacing="0" cellpadding="2">
				<tr>
                <td align="right" colspan="2">
                	<?php if (!$_GET['action']) echo '<a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=new_zone').'">'.BUTTON_INSERT.'</a>'; ?></td>
              </tr>
            </table>
			<?php
			  }
			?>
            </td>
			<?php
			  $heading = array();
			  $contents = array();

			  if ($_GET['action'] == 'list') {
			    switch ($_GET['saction']) {
			      case 'new':
			        $heading[] = array('text' => '<b>'.TEXT_INFO_HEADING_NEW_SUB_ZONE.'</b>');

			        $contents = array('form' => draw_form('zones', FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$_GET['sID'].'&saction=insert_sub'));
			        $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
			        $contents[] = array('text' => '<br />'.TEXT_INFO_COUNTRY.'<br />'.draw_pull_down_menu('zone_country_id', get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
			        $contents[] = array('text' => '<br />'.TEXT_INFO_COUNTRY_ZONE.'<br />'.draw_pull_down_menu('zone_id', prepare_country_zones_pull_down()));
			        $contents[] = array('align' => 'center', 'text' => '<br /><button type="submit" class="button" onclick="this.blur();">'.BUTTON_INSERT.'</button> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$_GET['sID']).'">'.BUTTON_CANCEL.'</a>');
			        break;

			      case 'edit':
			        $heading[] = array('text' => '<b>'.TEXT_INFO_HEADING_EDIT_SUB_ZONE.'</b>');

			        $contents = array('form' => draw_form('zones', FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id.'&saction=save_sub'));
			        $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
			        $contents[] = array('text' => '<br />'.TEXT_INFO_COUNTRY.'<br />'.draw_pull_down_menu('zone_country_id', get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
			        $contents[] = array('text' => '<br />'.TEXT_INFO_COUNTRY_ZONE.'<br />'.draw_pull_down_menu('zone_id', prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
			        $contents[] = array('align' => 'center', 'text' => '<br /><button type="submit" class="button" onclick="this.blur();">'. BUTTON_UPDATE.'</button> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id).'">'.BUTTON_CANCEL.'</a>');
			        break;

			      case 'DELETE':
			        $heading[] = array('text' => '<b>'.TEXT_INFO_HEADING_DELETE_SUB_ZONE.'</b>');

			        $contents = array('form' => draw_form('zones', FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id.'&saction=deleteconfirm_sub'));
			        $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
			        $contents[] = array('text' => '<br /><b>'.$sInfo->countries_name.'</b>');
			        $contents[] = array('align' => 'center', 'text' => '<br /><input type="submit" class="button" onClick="this.blur();" value="'.BUTTON_DELETE.'"/> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id).'">'.BUTTON_CANCEL.'</a>');
			        break;

			      default:
			        if (is_object($sInfo)) {
			          $heading[] = array('text' => '<b>'.$sInfo->countries_name.'</b>');

			          $contents[] = array('align' => 'center', 'text' => '<a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id.'&saction=edit').'">'.BUTTON_EDIT.'</a> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=list&spage='.$_GET['spage'].'&sID='.$sInfo->association_id.'&saction=DELETE').'">'.BUTTON_DELETE.'</a>');
			          $contents[] = array('text' => '<br />'.TEXT_INFO_DATE_ADDED.' '.date_short($sInfo->date_added));
			          if (not_null($sInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED.' '.date_short($sInfo->last_modified));
			        }
			        break;
			    }
			  } else {
			    switch ($_GET['action']) {
			      case 'new_zone':
			        $heading[] = array('text' => '<b>'.TEXT_INFO_HEADING_NEW_ZONE.'</b>');

			        $contents = array('form' => draw_form('zones', FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID'].'&action=insert_zone'));
			        $contents[] = array('text' => TEXT_INFO_NEW_ZONE_INTRO);
			        $contents[] = array('text' => '<br />'.TEXT_INFO_ZONE_NAME.'<br />'.draw_input_field('geo_zone_name'));
			        $contents[] = array('text' => '<br />'.TEXT_INFO_ZONE_DESCRIPTION.'<br />'.draw_input_field('geo_zone_description'));
			        $contents[] = array('align' => 'center', 'text' => '<br /><button type="submit" class="button" onclick="this.blur();">'.BUTTON_INSERT.'</button> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$_GET['zID']).'">'.BUTTON_CANCEL.'</a>');
			        break;

			      case 'edit_zone':
			        $heading[] = array('text' => '<b>'.TEXT_INFO_HEADING_EDIT_ZONE.'</b>');

			        $contents = array('form' => draw_form('zones', FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=save_zone'));
			        $contents[] = array('text' => TEXT_INFO_EDIT_ZONE_INTRO);
			        $contents[] = array('text' => '<br />'.TEXT_INFO_ZONE_NAME.'<br />'.draw_input_field('geo_zone_name', $zInfo->geo_zone_name));
			        $contents[] = array('text' => '<br />'.TEXT_INFO_ZONE_DESCRIPTION.'<br />'.draw_input_field('geo_zone_description', $zInfo->geo_zone_description));
			        $contents[] = array('align' => 'center', 'text' => '<br /><button type="submit" class="button" onclick="this.blur();">'. BUTTON_UPDATE.'</button> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id).'">'.BUTTON_CANCEL.'</a>');
			        break;

			      case 'delete_zone':
			        $heading[] = array('text' => '<b>'.TEXT_INFO_HEADING_DELETE_ZONE.'</b>');

			        $contents = array('form' => draw_form('zones', FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=deleteconfirm_zone'));
			        $contents[] = array('text' => TEXT_INFO_DELETE_ZONE_INTRO);
			        $contents[] = array('text' => '<br /><b>'.$zInfo->geo_zone_name.'</b>');
			        $contents[] = array('align' => 'center', 'text' => '<br /><input type="submit" class="button" onClick="this.blur();" value="'.BUTTON_DELETE.'"/> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id).'">'.BUTTON_CANCEL.'</a>');
			        break;

			      default:
			        if (is_object($zInfo)) {
			          $heading[] = array('text' => '<b>'.$zInfo->geo_zone_name.'</b>');

			          $contents[] = array('align' => 'center', 'text' => '<a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=edit_zone').'">'.BUTTON_EDIT.'</a> <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=delete_zone').'">'.BUTTON_DELETE.'</a>'.' <a class="button" onClick="this.blur();" href="'.href_link(FILENAME_GEO_ZONES, 'zpage='.$_GET['zpage'].'&zID='.$zInfo->geo_zone_id.'&action=list').'">'.BUTTON_DETAILS.'</a>');
			          $contents[] = array('text' => '<br />'.TEXT_INFO_NUMBER_ZONES.' '.$zInfo->num_zones);
			          $contents[] = array('text' => '<br />'.TEXT_INFO_DATE_ADDED.' '.date_short($zInfo->date_added));
			          if (not_null($zInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED.' '.date_short($zInfo->last_modified));
			          $contents[] = array('text' => '<br />'.TEXT_INFO_ZONE_DESCRIPTION.'<br />'.$zInfo->geo_zone_description);
			        }
			        break;
			    }
			  }

			if ( (not_null($heading)) && (not_null($contents)) ) {
				echo '<td width="25%" class="border" valign="top">'."\n";
				$box = new box;
				echo $box->infoBox($heading, $contents);
				echo '</td>'."\n";
			}
			?>
          </tr>
          </table>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
<?php require(DIR_WS_INCLUDES.'footer.php'); ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES.'application_bottom.php'); ?>